//
//  PFDefaultUserConfig.m
//  PrintFamily
//
//  Created by edaihua on 16/3/21.
//  Copyright © 2016年 ___PrintFactory___. All rights reserved.
//

#import "PFDefaultUserConfig.h"

@implementation PFDefaultUserConfig

+ (PhotoPrintType)getPrintType {
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    NSNumber *printType = [userDefaults objectForKey:@"PrintType"];
    if (printType == nil) {
        [PFDefaultUserConfig storePrintType:PhotoType_Rectangle_Medium];
        printType = [NSNumber numberWithInteger:PhotoType_Rectangle_Medium];
    }
    return printType.integerValue;
}

+ (void)storePrintType:(PhotoPrintType)type {
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    [userDefaults setObject:[NSNumber numberWithInteger:type] forKey:@"PrintType"];
    [userDefaults synchronize];
}

+ (PhotoBoarder)getBoarderType {
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    NSNumber *boarderType = [userDefaults objectForKey:@"BoarderType"];
    if (boarderType == nil) {
        [PFDefaultUserConfig storeBoarderType:PhotoBoarder_White];
        boarderType = [NSNumber numberWithInteger:PhotoBoarder_White];
    }
    return boarderType.integerValue;
}

+ (void)storeBoarderType:(PhotoBoarder)type {
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    [userDefaults setObject:[NSNumber numberWithInteger:type] forKey:@"BoarderType"];
    [userDefaults synchronize];
}

@end
